package com.ygqh.baby.model;

import com.foxinmy.weixin4j.util.StringUtil;
import com.ygqh.baby.ao.OrderStatus;
import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.utils.DateConvertUtils;

import java.util.Date;

/**
 * 〈〉
 *
 * @author guohao
 * @date 2019/4/17 17:17
 * @since 1.0.0
 */
public class OrderSendDetailSearchParam extends QueryInfo {


    private Long orderId;
    private Long subId;

    private OrderStatus orderStatus;

    private Date startDate;

    private Date endDate;

    private String userName;

    public Long getSubId() {
        return subId;
    }

    public void setSubId(Long subId) {
        this.subId = subId;
    }

    public OrderStatus getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(OrderStatus orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {

        if (orderId == null && subId == null && StringUtil.isBlank(userName) && endDate == null) {
            return DateConvertUtils.getCurrentWeekDate(7);
        }
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }
}
